Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Matrix Functions /


RectMatrix

The RectMatrix function allows your application to create a matrix that performs a translate and scale operation as described by the relationship between two rectangles.

pascal void RectMatrix (MatrixRecord *matrix, Rect *srcRect,
                        Rect *dstRect); 
matrix
Contains a pointer to a matrix structure. The RectMatrix function updates the contents of this matrix so that the matrix describes a transformation from points in the rectangle specified by the srcRect parameter to points in the rectangle specified by the dstRect parameter. The previous contents of the matrix are ignored.
srcRect
Contains a pointer to the source rectangle.
dstRect
Contains a pointer to the destination rectangle.
DESCRIPTION
You specify the two rectangles; the function returns the appropriate matrix. Figure 2-43 shows how this matrix transforms the source image.

Figure 2-43 Transforming an image with the RectMatrix function

Calling the RectMatrix function with the two rectangles shown in Figure 2-43 results in the matrix shown in Figure 2-44.

Figure 2-44 Matrix created as a result of calling the RectMatrix function

SEE ALSO
If you call the TransformRect function (described on page 2-328) and supply the matrix produced by the RectMatrix function along with the source rectangle you specified when you called the RectMatrix function, the result is equivalent to the destination rectangle you specified.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996